package com.cloud.business.dto;

import cn.hutool.json.JSONObject;
import com.cloud.business.enums.ResponseEnum;
import lombok.Data;

/**
 * @description :应答VO
 */
@Data
public class ResponseVO<T> {

    private Integer code;

    private String msg;

    private T data;

    public ResponseVO() {
    }

    private ResponseVO(Integer code, String message, T data) {
        this.code = code;
        this.msg = message;
        this.data = data;
    }

    private ResponseVO(ResponseEnum responseEnum) {
        this.code = responseEnum.getCode();
        this.msg = responseEnum.getMessage();
        this.data = (T)new JSONObject();
    }

    private ResponseVO(ResponseEnum responseEnum, T data) {
        this.code = responseEnum.getCode();
        this.msg = responseEnum.getMessage();
        this.data = data;
    }

}
